var MongoClient = require("mongodb").MongoClient;
var url = "mongodb://119.23.182.180:10086/srp";

MongoClient.connect(url, function (err, db) {
  if (err) throw err;
  var dbo = db.db("srp");
  var whereStr = { userName: "masaikk" }; // 查询条件
  var updateStr = { $set: { url: "https://www.runoob2.com" } };
  dbo.collection("code1").updateMany(whereStr, updateStr, function (err, res) {
    if (err) throw err;
    console.log("文档更新成功");
    db.close();
  });
});
